package com.juzipi.demo.tools;

import com.juzipi.demo.utils.ResultCode;

public class ResultTool {


    public static Result success(){
       return new Result(true);
    }

    public static Result fail(){
        return new Result(false);
    }

    //有返回值
    public static Result successData(Object data){
        return new Result(true,data);
    }

    public static Result failData(Object data){
        return new Result(false,data);
    }


    //成功失败都是自定义状态码和返回值
    public static Result successCustomize(ResultCode resultCode,Object data){
        return new Result(true,resultCode,data);
    }

    public static Result failCustomize(ResultCode resultCode,Object data){
        return new Result(false,resultCode,data);
    }



}
